package com.hxs.learn.mapper.core;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import org.springframework.stereotype.Component;

import com.hxs.learn.common.entity.TreeJson;
import com.hxs.learn.common.mapper.SuperMapper;
import com.hxs.learn.entity.core.SysMenu;
import com.hxs.learn.entity.core.SysRoleMenu;

/**
 * @author huxinsheng
 * @date 2018-04-24 15:26:25
 */
@Mapper
@Component
public interface SysRoleMenuMapper extends SuperMapper<SysRoleMenu> {

    /**
     * 根据角色id和父菜单id查询角色拥有菜单列表
     * @param roleId 角色id
     * @param pid 父菜单id
     * @return java.util.List
     */
    List<SysMenu> selectByRoleIdAndParentId(@Param("roleId") String roleId, @Param("pid") String pid);

    /**
     * 根据角色id和父菜单id查询角色拥有树形菜单列表
     * @param roleId 角色id
     * @param pid 父菜单id
     * @return java.util.List
     */
    List<TreeJson<Object>> selectRoleMenuTreeJsonByRoleId(@Param("roleId") String roleId, @Param("pid") String pid);
}


//~ Formatted by Jindent --- http://www.jindent.com
